<template>
	<view>
		<view v-for="(item,index) in data" :key="item.id">
		  postId:{{item.postId}} userId:{{item.userId}} 标题:{{item.title}} 内容:{{item.content}} 时间:{{item.date}}
		</view>
		<view v-if="showCheck" style="text-align: center;">您还没有下载过文档</view>
		<view v-if="check" style="text-align: center;padding-top: 80%;">欢迎您继续下载文档</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:[],
				showCheck:false,
				check:false
			}
		},
		methods: {
			
		},
		onLoad() {
			var that=this;
			uni.request({
				url: 'http://summer.codinglink.tech:65001/post/getAllPosts',
				method: 'GET',
				data: {},
				success: res => {
					that.data=res.data.data;
					that.check=true;
				},
				fail: () => {
					that.showCheck=true;
				},
				complete: () => {}
			});
		}
	}
</script>

<style>

</style>
